<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" type="text/css" href="/skin/css/amazeui.min1.css" />
<link href="/skin/font/iconfont.css" rel="stylesheet" type="text/css" />
<link href="/skin/css/index.css" rel="stylesheet" type="text/css" />
<script src="/skin/js/toast.js"></script>
<script src="/user/js/jquery.js"></script>
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<title>添加银行卡-会员中心</title>
<style>
/* 设计稿 375px，1rem = 100px，换算方法：px值 ÷ 100 = rem值 */
:root{ --card:#fff; --line:#eef2f7; --text:#0f172a; --muted:#9aa3b2; --primary:#253043; }
a{-webkit-tap-highlight-color:transparent;outline:none;}
body { background: #f3f5f8; }

/* 表单卡片 */
.form-card {
	background: var(--card);
	border-radius:0.04rem;
	padding: 0.16rem;
	margin: 0.16rem;
	box-shadow: 0 0.03rem 0.18rem rgba(0,0,0,.05);
}
.form-item {
	display: flex;
	align-items: center;
	padding: 0.14rem 0;
	border-bottom: 0.01rem solid var(--line);
}
.form-item:last-child {
	border-bottom: 0;
}
.form-label {
	width: 1rem;
	flex: 0 0 1rem;
	color: #1f2937;
	font-weight: 600;
	font-size: 0.14rem;
}
.form-control {
	flex: 1;
	display: flex;
	align-items: center;
	min-width: 0;
}
.form-control input[type=text] {
	width: 100%;
	border: 0;
	background: transparent;
	outline: none;
	font-size: 0.14rem;
	color: #111827;
	padding: 0;
	margin: 0;
	-webkit-tap-highlight-color: transparent;
}
.form-control input::placeholder {
	color: #c0c7d2;
}

/* 提交按钮 */
.page-actions {
	padding: 0 0.2rem 0.2rem;
}
.primary-btn {
	width: 100%;
	height: 0.48rem;
	border: 0;
	border-radius: 0.02rem;
	background: #253043;
	color: #fff;
	font-size: 0.16rem;
	font-weight: 700;
	-webkit-tap-highlight-color: transparent;
	outline: none;
}
.primary-btn:active {
	background: #1f2937;
}
</style>
<script>
	// 设计稿 375px，1rem = 100px，换算方法：px值 ÷ 100 = rem值
	(function(){
		var docEl = document.documentElement;
		var resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize';
		function recalc() {
			var clientWidth = docEl.clientWidth;
			if (!clientWidth) return;
			docEl.style.fontSize = (clientWidth / 375 * 100) + 'px';
		}
		if (!document.addEventListener) return;
		window.addEventListener(resizeEvt, recalc, false);
		document.addEventListener('DOMContentLoaded', recalc, false);
		recalc();
	})();
</script>
</head>
<body class="body">
<div class="main">
<div class="editzl">
	<header id="header">
		<section class="head-b head-b1">
			<span class="u-left"><a href="javascript:history.go(-1);" class="back"><img src="/skin/img/back.png"/></a></span>
			<h1 id="t0">添加银行卡</h1>
			<div class="u-right" href="#">
				<a href="/" class="hSearch right"><img src="/skin/img/i_home.png"/></a>
			</div>
		</section>
	</header>
	
	<form class="xx">
		<div class="form-card">
			<div class="form-item">
				<div class="form-label">开户行</div>
				<div class="form-control">
					<input type="text" name="t1" placeholder="请填写开户银行" value="" />
				</div>
			</div>
			<div class="form-item">
				<div class="form-label">银行卡号</div>
				<div class="form-control">
					<input type="text" name="t2" placeholder="请填写银行卡号" value="" />
				</div>
			</div>
			<div class="form-item">
				<div class="form-label">持卡人姓名</div>
				<div class="form-control">
					<input type="text" name="t3" placeholder="请填写持卡人姓名" value="" />
				</div>
			</div>
			<div class="form-item">
				<div class="form-label">身份证号</div>
				<div class="form-control">
					<input type="text" name="t4" placeholder="请填写持卡人身份证号" value="" />
				</div>
			</div>
		</div>
		
		<div class="page-actions">
			<button class="primary-btn" type="button" onclick="edit();">立即添加</button>
		</div>
	</form>
</div>
</div>

<script>
function edit(){
	var bank = $("input[name=t1]").val().trim();
	if(!bank) {
		showToast("请填写开户银行",'error');
		return;
	}
	
	var card = $("input[name=t2]").val().trim();
	if(!card) {
		showToast("请填写银行卡号",'error');
		return;
	}
	
	var name = $("input[name=t3]").val().trim();
	if(!name) {
		showToast("请填写持卡人姓名",'error');
		return;
	}
	
	$.ajax({
		type:"post",
		dataType:"json",
		url:"/Moudelu.php?m=m&a=bank_add",
		data:$(".xx").serialize(),
		success:function(d){
			if(d[0]==2){
				window.location.href='login.php';
				return false;
			}
			if(d[0]==0){
				showToast(d[1],'error');
			}
			else{
				showToast(d[1],'success');
				window.location.href='/user/bank.php';
			}
		}
	});
}
</script>
{include(foot)}
</body>
</html>
